import request from '@/hooks/request'

const Api = {
  getOrderRateList: '/fish/orderRate/getOrderRateList', //查询订单评论列表
  getTemplateList: '/fish/orderRate/rateTemplateList', //获取评价列表
  addTemplate: '/fish/orderRate/addRateTemplate', //新增模板
  delTemplate: '/fish/orderRate/deleteRateTemplate', //删除模板
  editTemplate: '/fish/orderRate/editRateTemplate', //编辑模板
  firstRate: '/fish/orderRate/firstRate', //订单首评
  pursueRate: '/fish/orderRate/pursueRate', //订单追评
  push: '/fish/orderRate/rateTemplatePushRobots', //推送
  pullData: '/fish/orderRate/getRobotRateTemplate', //拉取配置
  synchronousOrderRate: '/fish/orderRate/synchronousOrderRate', //同步
  OrderRateInfo: '/fish/orderRate/getOrderRateInfo', //查询订单评论详情
}

export const getOrderRateInfo = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.OrderRateInfo,
    data: parameter,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  })
}

export const synchronousOrderRate = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.synchronousOrderRate,
    data: parameter,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  })
}

export const PushTemplateList = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.push,
    data: parameter,
  })
}

export const pullTemplateList = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.pullData,
    data: parameter,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  })
}

export const getTemplateList = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.getTemplateList,
    data: parameter,
  })
}
export const FirstRate = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.firstRate,
    data: parameter,
  })
}
export const PursueRate = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.pursueRate,
    data: parameter,
  })
}

export const addRateTemplate = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.addTemplate,
    data: parameter,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  })
}

export const delTemplate = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.delTemplate,
    data: parameter,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  })
}
export const editTemplate = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.editTemplate,
    data: parameter,
  })
}

export const getOrderRateList = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.getOrderRateList,
    data: parameter,
  })
}
